import axios from 'axios';
import * as constants from './constants';

const changeRegister = () => ({
  type: constants.CHANGE_REGISTER,
  value: true
})

export const register = (accout, password) => {
  return (dispatch) => {
    axios.get('/api/register').then((res) => {
      const result = res.data.data
      if (result) {
        dispatch(changeRegister())
      } else {
        alert('注册失败')
      }
    })
  }
}